
#ifndef __QQMACRS__
#define __QQMACRS__



#define VTBL(iname) iname##Vtbl

//#define AEEINITVTBL(p,iname,vt)  (AEEGETPVTBL(p,iname) = (AEEVTBL(iname)*)(void*)&vt)


// ### Deprecated ###
#define OBJECT(n) \
	typedef struct n n;\
struct n

// Get object ptr from interface ptr
//#define ME(pme,cls,pif)          (cls * pme = ((cls*)(void*)(pif)))

// ### Deprecated ### - Use AEEINTERFACE(), in AEEInterface.h
#define QINTERFACE(iname) struct _##iname {\
	struct VTBL(iname)  *pvt; \
                           };\
                           typedef struct VTBL(iname) VTBL(iname); \
struct VTBL(iname)


// Use as first member of classes that override QINTERFACE()
#define DECLARE_VTBL(iname)      iname   vt##iname;

// returns an 'iname'Vtbl *

#define GET_PVTBL(p,iname)       ((iname*)(void*)p)->pvt

// initialize the vtbl

#define INIT_VTBL(p,iname,vt)    (GET_PVTBL(p,iname) = (VTBL(iname) *)(void*)&vt)
#define FREE_VTBL(p,iname)


// ### Deprecated ### - Use INHERIT_IBase() in AEEInterface.h
#define DECLARE_IBASE(iname) \
	unsigned long  (*AddRef)         (iname*);\
  unsigned long  (*Release)        (iname*);


#endif
